package com.wqtz.chechai.adapter;

import android.view.View;

import com.orhanobut.logger.Logger;
import com.wqtz.chechai.R;
import com.wqtz.chechai.base.rebaseadapter.MyHolder;
import com.wqtz.chechai.base.rebaseadapter.RecyclerAdapter;
import com.wqtz.chechai.dao.Province;

import java.util.List;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/22 14:42
 */

public class ProvinceAdapter extends RecyclerAdapter<Province> {
	List<Province> data;
	OnItemLickListener mLickListener ;


	public ProvinceAdapter(int rsId, List<Province> data) {
		super(rsId, data);
		this.data = data;
	}

	public void setOnItemClickListen(OnItemLickListener mLickListener){
		this.mLickListener = mLickListener;
	}

	@Override
	public int itemType(int position) {
		return 0;
	}

	@Override
	public void onBindMyViewHolder(final MyHolder holder, final int position, List<Province> data) {
		Logger.e(data.size()+"");
		holder.setText(R.id.tv_provicename,data.get(position).getProName());
		holder.getView(R.id.tv_provicename).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				mLickListener.onItemLick(position,holder);
			}
		});

	}

	public interface OnItemLickListener {
		void onItemLick(int position,MyHolder holder);
	}



}
